Wireless projection method and apparatus

ABSTRACT

Embodiments of this application provide a wireless projection method and apparatus, and relate to the communication field, to reduce image tearing and freezing and image quality deterioration occurring in wireless projection, and improve user experience. The wireless projection method is applied to a Wi-Fi communication system, and includes: An electronic device transmits a scalable video coding slice of a first video frame to a display device in a first video transmission period; obtains channel state information that is fed back by the display device and that is for transmitting the first video frame; and selectively enables a retry mechanism based on the channel state information.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2020/141022, filed on Dec. 29, 2020, the disclosure of which ishereby incorporated by reference in its entirety.

TECHNICAL FIELD

This application relates to the communication field, and in particular,to a wireless projection method and apparatus.

BACKGROUND

Wireless projection is a technology in which screen information of aterminal such as a mobile phone or a tablet is coded and compressed,then wirelessly delivered to a large-screen device such as a televisionor a virtual reality (virtual reality, VR) device by using a Wi-Fitechnology (a wireless local area network technology created by theWi-Fi Alliance in the Institute of Electrical and Electronic Engineers(institute of electrical and electronic engineers, IEEE) 802.11standard), and then decoded, displayed, and output.

An existing wireless projection compression and transmission technologyis mostly performed in video frames, which has disadvantages such as ahigh end-to-end delay and a weak anti-interference capability, andgreatly limits application of the wireless projection compression andtransmission technology in scenarios such as office, games, and VR. Alow-delay wireless projection solution combining source coding and awireless channel transmission technology can resolve the foregoingproblems to some extent. In this solution, a terminal continuouslydivides each frame of video data into a plurality of data slices(slices) through source coding, and uses a scalable video codingtechnology on each slice to obtain a plurality of scalable bitstreams(layers, for example, one basic layer and a plurality of enhancementlayers) with scaled-quality (or resolution). The terminal performs Wi-Fitransmission on the scalable bitstream of the slice in a configuredvideo transmission period (video service period, VSP). In this case, theterminal needs to transmit one slice in a fixed time period in the VSP.If the transmission is not completed, the terminal needs to discard theslice, so that normal transmission of subsequent slices is not affected.Because scalable video coding is performed on each slice, for eachslice, when Wi-Fi transmission of the basic layer succeeds buttransmission of the enhancement layer fails, a bitstream having poorquality can still be decoded, to achieve capabilities of low-delaytransmission and adapting to a wireless channel transmissionfluctuation.

However, wireless channel interference is usually burst interference.The foregoing solution resists a channel capacity fluctuation onlythrough scalable coding, resulting in a limited capability. Especially,when interference is strong in Wi-Fi environments, the basic layer oftenfails to be correctly transmitted within a time period. In this case,image tearing and freezing and image quality deterioration occur inwireless projection. This affects user experience.

SUMMARY

This application provides a wireless projection method and apparatus, toreduce image tearing and freezing and image quality deteriorationoccurring in wireless projection, and improve user experience.

According to a first aspect, a wireless projection method is provided.The wireless projection method is applied to a Wi-Fi communicationsystem, and an electronic device is connected to a display devicethrough wireless fidelity Wi-Fi. The wireless projection methodincludes: The electronic device transmits a scalable video coding sliceof a first video frame to the display device in a first videotransmission period; the electronic device obtains channel stateinformation that is fed back by the display device and that is fortransmitting any scalable video coding slice of the first video frame;and the electronic device selectively enables a retry mechanism based onthe channel state information. The retry mechanism is that theelectronic device transmits a first scalable video coding slice of asecond video frame to the display device in a first time period in asecond video transmission period, and transmits, to the display devicein at least one another time period after the first time period, aportion that is of the first scalable video coding slice and that isdiscarded in the first time period. One another scalable video codingslice of the second video frame is transmitted in the at least oneanother time period. In this way, the electronic device can firsttransmit a scalable video coding slice of a video frame in a videotransmission period, for example, transmit one scalable video codingslice in a time period in a video transmission period in an initialstate. Certainly, if transmission of the scalable video coding slice isnot completed in a corresponding time period, the scalable video codingslice is directly discarded. Then, the electronic device obtains thechannel state information that is fed back by the display device andthat is for transmitting any scalable video coding slice of the firstvideo frame. For example, after each time period, the channel stateinformation for transmitting the scalable video coding slice in the timeperiod may be obtained. It may be understood that the channel stateinformation may reflect a portion that is of the scalable video codingslice and that is discarded in the corresponding time period. Forexample, a channel state may be a total quantity of data packets of thescalable video coding slice transmitted in one time period and aquantity of data packets that are successfully transmitted. In this way,the electronic device may selectively enable the retry mechanism basedon the channel state information. For example, if the electronic devicedetermines, based on the channel state information, that channel qualityis poor, the electronic device enables the retry mechanism; or whenchannel quality is good, the electronic device does not enable the retrymechanism; or when the retry mechanism is already enabled, theelectronic device disables the retry mechanism when determining thatchannel quality is good. The retry mechanism is that the electronicdevice transmits one scalable video coding slice in a plurality of timeperiods in a subsequent video transmission period, for example,transmits a first scalable video coding slice of another video frame toa display device in a first time period in a subsequent videotransmission period, and transmits, to the display device in at leastone another time period after the first time period, a portion that isof the first scalable video coding slice and that is discarded in thefirst time period. One another scalable video coding slice of the secondvideo frame is transmitted in the at least one another time period. Inthis way, when one scalable video coding slice has a discarded portionin a corresponding time period, the discarded portion may be transmittedin another time period. For example, when transmission of one or more ofa basic layer and at least one enhancement layer of a scalable videocoding slice of a slice is not completed in a corresponding time period,the basic layer and the at least one enhancement layer have anopportunity of being transmitted in a next time period. In this way, thedisplay device may perform decoding with reference to the first scalablevideo coding slices transmitted in the two time periods, to ensuresuccessful transmission of the scalable video coding slice as much aspossible on the premise that a portion of a delay is sacrificed, reduceimage tearing and freezing and image quality deterioration occurring inwireless projection, and improve user experience.

In a possible implementation, the scalable video coding slice includesone basic layer and at least one enhancement layer; and that theelectronic device transmits a first scalable coding slice of a secondvideo frame in a first time period in a second video transmission periodincludes that the electronic device transmits a basic layer and at leastone enhancement layer of the first scalable video coding slice of thesecond video frame to the display device in the first time period in thesecond video transmission period based on transmission priorities of thebasic layer and the at least one enhancement layer of the first scalablevideo coding slice of the second video frame. Generally, scalable videocoding is performed on each slice of the first video frame to obtain thescalable video coding slice. Therefore, for each scalable video codingslice, based on the transmission priorities, when the basic layer issuccessfully transmitted but the enhancement layer fails to betransmitted, a bitstream having poor quality can still be decoded, toachieve capabilities of low-delay transmission and adapting to awireless channel transmission fluctuation.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer, the at leastone another time period includes a second time period in the secondvideo transmission period, and the another scalable video coding sliceincludes a second scalable video coding slice of the second video frame.

That the electronic device transmits, to the display device in at leastone another time period after the first time period, a portion that isof the first scalable video coding slice and that is discarded in thefirst time period includes that the electronic device transmits, to thedisplay device in the second time period based on the transmissionpriorities of the basic layer and the at least one enhancement layer ofthe first scalable video coding slice and transmission priorities of abasic layer and at least one enhancement layer of the second scalablevideo coding slice, the portion that is of the first scalable videocoding slice and that is discarded and the second scalable video codingslice. The transmission priority of the basic layer of the firstscalable video coding slice is higher than the transmission priority ofthe basic layer of the second scalable video coding slice, thetransmission priority of the basic layer of the second scalable videocoding slice is higher than the transmission priority of the enhancementlayer of the first scalable video coding slice, and the transmissionpriority of the enhancement layer of the first scalable video codingslice is higher than the transmission priority of the enhancement layerof the second scalable video coding slice. In this way, data transmittedin the second time period may be transmitted in a manner ofpreferentially transmitting the basic layer of the first scalable videocoding slice, then transmitting the basic layer of the second scalablecoding slice, then transmitting the enhancement layer of the firstscalable coding slice, and finally transmitting the enhancement layer ofthe second scalable coding slice. This preferentially ensures that thebasic layer of each scalable video coding slice is transmittedsuccessfully in sequence in the corresponding time period, and thenensures that the enhancement layer of each scalable video coding sliceis transmitted successfully in sequence in the time period.

In a possible implementation, the discarded portion of the firstscalable video coding slice includes the basic layer and the at leastone enhancement layer of the first scalable video coding slice; that theelectronic device transmits, to the display device in at least oneanother time period after the first time period, a portion that is ofthe first scalable video coding slice and that is discarded in the firsttime period includes that the electronic device transmits the basiclayer and the at least one enhancement layer of the first scalable videocoding slice to the display device in the at least one another timeperiod after the first time period. In this solution, if both the basiclayer and the at least one enhancement layer of the first scalable videocoding slice are discarded in the second video transmission period, thatis, (transmission is not completed), the basic layer and the at leastone enhancement layer of the first scalable video coding slice may beretransmitted in the at least one another time period after the firsttime period.

In a possible implementation, a discarded portion of the first scalablevideo coding slice includes the at least one enhancement layer of thefirst scalable video coding slice; that the electronic device transmits,to the display device in at least one another time period after thefirst time period, a portion that is of the first scalable video codingslice and that is discarded in the first time period includes that theelectronic device transmits the at least one enhancement layer of thefirst scalable video coding slice to the display device in the at leastone another time period after the first time period. In this solution,if only the at least one enhancement layer of the first scalable videocoding slice is discarded (transmission is not completed) in the firsttime period, only the at least one enhancement layer of the firstscalable video coding slice may be retransmitted in the at least oneanother time period after the first time period.

In a possible implementation, the method further includes: after the atleast one another time period, reconstructing a reference frame based onthe successfully transmitted portion of the first scalable video codingslice; and generating first scalable video coding of a third video framebased on the reference frame. In this way, when the electronic devicetransmits the third video frame, for the first scalable video codingslice of the second video frame, reference may be made to portions thatare successfully transmitted in the first time period and the at leastone another time period after the first time period. In this way, formedinter-predictive frame (predictive frame, P frame for short) coding canreduce an amount of data to be coded, and help ensure that the thirdvideo frame of the electronic device can be decoded based on an actuallysuccessfully transmitted portion after being transmitted to the displaydevice.

According to a second aspect, a wireless projection methodis provided.The wireless projection applied to a Wi-Fi communication system, and anelectronic device is connected to a display device through wirelessfidelity Wi-Fi. The wireless projection method includes: The displaydevice receives a scalable video coding slice of a first video framethat is transmitted by the electronic device to the display device in afirst video transmission period; and the display device feeds back, tothe electronic device, channel state information for transmitting thefirst video frame. The electronic device selectively enables a retrymechanism based on the channel state information. The display devicedecodes the scalable video coding slice transmitted by the electronicdevice in the first video transmission period; the display devicereceives a first scalable video coding slice of a second video frametransmitted by the electronic device in a first time period in a secondvideo transmission period in the retry mechanism; and the display devicereceives a portion that is of the first scalable video coding slice andthat is discarded in the first time period and that is transmitted bythe electronic device in at least one another time period after thefirst time period. One another scalable video coding slice of the secondvideo frame is transmitted in the at least one another time period; andthe display device decodes the first scalable video coding slice of thesecond video frame transmitted by the electronic device in the firsttime period and a portion that is of the first scalable video codingslice and that is discarded in the first time period and that istransmitted in the at least one another time period after the first timeperiod.

In a possible implementation, the scalable video coding slice includesone basic layer and at least one enhancement layer; and that the displaydevice receives a first scalable video coding slice of a second videoframe transmitted by the electronic device in a first time period in asecond video transmission period includes: The display device receivesthe basic layer and the at least one enhancement layer of the firstscalable video coding slice of the second video frame that aretransmitted by the electronic device in the first time period in thesecond video transmission period based on transmission priorities of thebasic layer and the at least one enhancement layer of the first scalablevideo coding slice.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer; and that thedisplay device receives a portion that is of the first scalable videocoding slice and that is discarded in the first time period and that istransmitted by the electronic device in at least one another time periodafter the first time period includes: The display device receives thebasic layer and the at least one enhancement layer that are of the firstscalable video coding slice and that are transmitted by the electronicdevice in the at least one another time period after the first timeperiod.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer; and that thedisplay device receives a portion that is of the first scalable videocoding slice and that is discarded in the first time period and that istransmitted by the electronic device in at least one another time periodafter the first time period includes: The display device receives the atleast one enhancement layer of the first scalable video coding slicetransmitted by the electronic device in the at least one another timeperiod after the first time period.

According to a third aspect, a wireless projection apparatus isprovided, used in a Wi-Fi communication system. The wireless projectionapparatus may be an electronic device, the wireless projection apparatusmay be a module or a chip in the electronic device, or the electronicdevice may be a chip or a system on chip, and the wireless projectionapparatus includes: A transmitter is configured to transmit, a scalablevideo coding slice of a first video frame to a display device in a firstvideo transmission period. A receiver is configured to obtain channelstate information that is fed back by the display device and that is fortransmitting the first video frame. A processor is configured toselectively enable a retry mechanism based on the channel stateinformation obtained by the receiver. The retry mechanism is that thetransmitter is further configured to: transmit a first scalable videocoding slice of a second video frame to the display device in a firsttime period in a second video transmission period, and transmit, to thedisplay device in at least one another time period after the first timeperiod, a portion that is of the first scalable video coding slice andthat is discarded in the first time period. One another scalable videocoding slice of the second video frame is transmitted in the at leastone another time period.

In a possible implementation, the scalable video coding slice includesone basic layer and at least one enhancement layer; and the transmitteris specifically configured to transmit the basic layer and the at leastone enhancement layer of the first scalable video coding slice of thesecond video frame to the display device in the first time period in thesecond video transmission period based on transmission priorities of thebasic layer and the at least one enhancement layer of the first scalablevideo coding slice of the second video frame.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer, the at leastone another time period includes a second time period in the secondvideo transmission period, and the another scalable video coding sliceincludes a second scalable video coding slice of the second video frame.The transmitter is specifically configured to transmit, to the displaydevice in the second time period based on the transmission priorities ofthe basic layer and the at least one enhancement layer of the firstscalable video coding slice and transmission priorities of a basic layerand at least one enhancement layer of the second scalable video codingslice, the portion that is of the first scalable video coding slice andthat is discarded and the second scalable video coding slice. Thetransmission priority of the basic layer of the first scalable videocoding slice is higher than the transmission priority of the basic layerof the second scalable video coding slice, the transmission priority ofthe basic layer of the second scalable video coding slice is higher thanthe transmission priority of the enhancement layer of the first scalablevideo coding slice, and the transmission priority of the enhancementlayer of the first scalable video coding slice is higher than thetransmission priority of the enhancement layer of the second scalablevideo coding slice.

In a possible implementation, the discarded portion of the firstscalable video coding slice includes the basic layer and the at leastone enhancement layer of the first scalable video coding slice; and thetransmitter is specifically configured to transmit the basic layer andthe at least one enhancement layer of the first scalable video codingslice to the display device in the at least one another time periodafter the first time period.

In a possible implementation, the discarded portion of the firstscalable video coding slice includes the at least one enhancement layerof the first scalable video coding slice; and the transmitter isspecifically configured to transmit the at least one enhancement layerof the first scalable video coding slice to the display device in the atleast one another time period after the first time period.

In a possible implementation, the processor is further configured to:after the at least one another time period, reconstruct a referenceframe based on a successfully transmitted portion of the first scalablevideo coding slice; and generate first scalable video coding of a thirdvideo frame based on the reference frame.

According to a fourth aspect, a wireless projection apparatus isprovided, used in a Wi-Fi communication system. The wireless projectionapparatus may be a display device, the wireless projection apparatus maybe a module or a chip in the display device, and the display device maybe a chip or a system on chip, and the wireless projection apparatusincludes: A receiver is configured to receive a scalable video codingslice of a first video frame that is transmitted by an electronic deviceto the display device in a first video transmission period. Atransmitter is configured to feed back, to the electronic device,channel state information for transmitting the first video frame. Theelectronic device selectively enables a retry mechanism based on thechannel state information. A processor is configured to decode thescalable video coding slice transmitted by the electronic device in thefirst video transmission period. A receiver is further configured toreceive a first scalable video coding slice of a second video frametransmitted by the electronic device in a first time period in a secondvideo transmission period in the retry mechanism; and receive a portionthat is of the first scalable video coding slice and that is discardedin the first time period and that is transmitted by the electronicdevice in at least one another time period after the first time period.One another scalable video coding slice of the second video frame istransmitted in the at least one another time period. The processor isfurther configured to decode the first scalable video coding slice ofthe second video frame transmitted by the electronic device in the firsttime period and the portion that is of the first scalable video codingslice and that is discarded in the first time period and that istransmitted in the at least one another time period after the first timeperiod.

In a possible implementation, the scalable video coding slice includesone basic layer and at least one enhancement layer; and the receiver isspecifically configured to receive the basic layer and the at least oneenhancement layer of the first scalable video coding slice of the secondvideo frame that are transmitted by the electronic device in the firsttime period in the second video transmission period based ontransmission priorities of the basic layer and the at least oneenhancement layer of the first scalable video coding slice.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer; and thereceiver is specifically configured to receive the basic layer and theat least one enhancement layer of the first scalable video coding slicethat are transmitted by the electronic device in the at least oneanother time period after the first time period.

In a possible implementation, the scalable video coding slice includesthe one basic layer and the at least one enhancement layer; and thereceiver is specifically configured to receive the at least oneenhancement layer of the first scalable video coding slice transmittedby the electronic device in the at least one another time period afterthe first time period.

According to a fifth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium stores a computerprogram. When the computer program is run on a computer, the computer isenabled to perform the method according to any one of the foregoingaspects.

According to a sixth aspect, a computer program product includinginstructions is provided. The computer program product includes computerprogram code. When the computer program code is run on a computer, thecomputer is enabled to perform the method according to any one of theforegoing aspects.

According to a seventh aspect, a communication system is provided. Thecommunication system includes the wireless projection apparatus in thethird aspect and the wireless projection apparatus in the fourth aspect.In an example, the wireless projection apparatus according to the thirdaspect may be an electronic device, for example, a mobile phone; and thewireless projection apparatus according to the fourth aspect may be adisplay device, for example, a radio television set.

For technical effects brought by any design manner of the second to theseventh aspects, refer to the technical effects brought by differentdesign manners of the first aspect. Details are not described hereinagain.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an architecture of a communicationsystem according to an embodiment of this application;

FIG. 2 is a schematic diagram of a functional architecture of anelectronic device according to an embodiment of this application;

FIG. 3 is a schematic diagram of a pipeline structure of a wirelessprojection method according to an embodiment of this application;

FIG. 4 is a schematic diagram of a structure of a wireless projectionapparatus according to an embodiment of this application;

FIG. 5 is a schematic flowchart of a wireless projection methodaccording to an embodiment of this application;

FIG. 6 is a schematic diagram of a pipeline structure of a wirelessprojection method according to another embodiment of this application;

FIG. 7 is a schematic diagram of a pipeline structure of a wirelessprojection method according to still another embodiment of thisapplication;

FIG. 8 is a schematic diagram of a structure of a wireless projectionapparatus according to another embodiment of this application; and

FIG. 9 is a schematic diagram of a structure of a wireless projectionapparatus according to still another embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The terms “first” and “second” mentioned below are merely intended for apurpose of description, and shall not be understood as an indication orimplication of relative importance or implicit indication of the numberof indicated technical features. Therefore, a feature limited by “first”or “second” may explicitly or implicitly include one or more features.In the description of embodiments of this application, unless otherwisespecified, “a plurality of” means two or more than two.

Currently, a terminal can perform coding and compression on screeninformation of the terminal by using a wireless projection technology,then wirelessly deliver the screen information to a large-screen devicesuch as a television or a VR device by using a Wi-Fi technology, andthen decode, display, and output the screen information. A low-delaywireless projection solution combining source coding and a wirelesschannel transmission technology can reduce disadvantages such as a highend-to-end delay and a weak anti-interference capability to some extent.A main principle of the low-delay wireless projection solution combiningthe source coding and the wireless channel transmission technology is asfollows: The terminal continuously divides each frame of video data intoa plurality of slices based on the source coding, and uses a scalablevideo coding technology on each slice to obtain a plurality of layerswith quality (or resolution) scaled. The terminal performs Wi-Fitransmission on a scalable bitstream of the slice in a configured VSP.In this case, the terminal needs to transmit one slice in a time periodin the VSP. If the transmission is not completed, the terminal needs todiscard the slice, so that normal transmission of subsequent slices isnot affected. Because scalable video coding is performed on each slice,for each slice, when Wi-Fi transmission of a basic layer succeeds buttransmission of an enhancement layer fails, a bitstream having poorquality can still be decoded, to achieve capabilities of low-delaytransmission and adapting to a wireless channel transmissionfluctuation. However, wireless channel interference is usually burstinterference. The foregoing solution resists a channel capacityfluctuation only by using scalable coding, resulting in a limitedcapability. Especially, when interference is strong in Wi-Fienvironments, the basic layer often fails to be correctly transmittedwithin a time period. In this case, image tearing and freezing and imagequality deterioration occur in wireless projection. This affects userexperience.

Embodiments of this application provide a wireless projection method.The wireless projection method may be applied to a Wi-Fi communicationsystem. In the Wi-Fi communication system, an electronic device isconnected to a display device through wireless fidelity Wi-Fi. Theelectronic device wirelessly delivers screen information of theelectronic device to the display device, and then decodes, displays, andoutputs the screen information. By using the wireless projection methodprovided in embodiments, the electronic device transmits a scalablevideo coding slice of a first video frame to the display device in afirst video transmission period. One scalable video coding slice of thefirst video frame is correspondingly transmitted in one time period inthe first video transmission period. For example, the electronic deviceperforms scalable video coding on a plurality of data slices of thefirst video frame in sequence to generate a plurality of scalable videocoding slices. For example, the electronic device codes a plurality ofdata slices of the first video frame into a plurality of the scalablevideo coding slices. The one scalable video coding slice may include abasic layer and at least one enhancement layer; and then the electronicdevice transmits the scalable video coding slice of the video frame oneach time period in the video transmission period. The electronic devicetransmits one scalable video coding slice in a time period in a videotransmission period in an initial state. Certainly, if transmission ofthe scalable video coding slice is not completed in a corresponding timeperiod, the scalable video coding slice is directly discarded. Then, theelectronic device obtains channel state information that is fed back bythe display device and that is for transmitting any scalable videocoding slice of the first video frame. For example, after each timeperiod, the channel state information for transmitting the scalablevideo coding slice in the time period may be obtained. It may beunderstood that the channel state information may reflect a portion thatis of the scalable video coding slice and that is discarded in thecorresponding time period. For example, the channel state informationmay be a total quantity of data packets of the scalable video codingslice transmitted in one time period and a quantity of data packets thatare successfully transmitted. In this way, the electronic device mayselectively enable the retry mechanism based on the channel stateinformation. For example, if the electronic device determines, based onthe channel state information, that channel quality is poor, theelectronic device enables the retry mechanism; or when channel qualityis good, the electronic device does not enable the retry mechanism; orwhen the retry mechanism is already enabled, the electronic devicedisables the retry mechanism when determining that channel quality isgood. The retry mechanism is that the electronic device transmits onescalable video coding slice in a plurality of time periods in asubsequent video transmission period, for example, transmits a firstscalable video coding slice of another video frame to a display devicein a first time period in a subsequent video transmission period, andtransmits, to the display device in the at least one another time periodafter the first time period, a portion that is of the first scalablevideo coding slice and that is discarded in the first time period. Oneanother scalable video coding slice of a second video frame istransmitted in the at least one another time period. In this way, whenone scalable video coding slice has a discarded portion in acorresponding time period, the discarded portion may be transmitted inanother time period. For example, when one or more of a basic layer andat least one enhancement layer of the scalable video coding slice of aslice is discarded (transmission is not completed) in a correspondingtime period, the basic layer and the at least one enhancement layer havean opportunity of being transmitted in a next time period. In this way,the display device may perform decoding with reference to the firstscalable video coding slices transmitted in the two time periods, toensure successful transmission of the scalable video coding slice asmuch as possible on the premise that a portion of a delay is sacrificed,reduce image tearing and freezing and image quality deteriorationoccurring in wireless projection, and improve user experience. Inaddition, after the at least one another time period, a reference frameis reconstructed based on the successfully transmitted portion of thefirst scalable video coding slice, and the first scalable video codingof a third video frame is generated based on the reference frame. Inthis way, when the electronic device transmits the third video frame,for the first scalable video coding slice of the second video frame,reference may be made to portions that are successfully transmitted inthe first time period and the at least one another time period after thefirst time period. In this way, formed inter-predictive frame(predictive frame, P frame for short) coding can reduce an amount ofdata to be coded, and help ensure that the third video frame of theelectronic device can be decoded based on an actually successfullytransmitted portion after being transmitted to the display device.

The following describes in detail a wireless projection method and anapparatus provided in embodiments of this application with reference tothe accompanying drawings.

FIG. 1 is a schematic diagram of a communication system to which awireless projection method is applied according to an embodiment of thisapplication. As shown in FIG. 1 , the communication system includes anelectronic device 100 and a display device 200. The electronic device100 may be connected to the display device 200 through a wirelessnetwork, for example, through a Wi-Fi network.

In some embodiments, the electronic device 100 sends content displayedon a screen to the display device 200 through the Wi-Fi network, and thedisplay device 200 displays the content. In other words, in a wirelessprojection process, display content of the electronic device 100 is thesame as that of the display device 200. For details, refer to aschematic diagram of a principle of wireless projection in FIG. 2 . Theelectronic device 100 may have the following functions. First, theelectronic device 100 can display a video frame as a screen image, andcan capture the displayed screen image as a video frame for framebuffering. In addition, the electronic device 100 can provideframe-level timing, to be specific, divide a video frame into aplurality of slices in sequence based on a VSP, and each time period inthe VSP corresponds to one slice. The electronic device 100 can performscalable video coding (scalable video coding, SVC) (coding 1 to coding 8as shown in FIG. 3 ) on a slice, for example, split a slice into aplurality of resolution, quality, and frame rate layers. The electronicdevice 100 may adjust a coding bit rate of a slice based on a channelstate. In other words, the slice is divided in terms of time, space, andquality, and multi-layer bitstreams (including a basic layer and anenhancement layer) are output. Data of the basic layer may enable thedisplay device 200 to decode basic video content completely andnormally, but a video image obtained by using the data of the basiclayer may have a low frame rate, low resolution, or low quality. When achannel is limited or a channel environment is complex, it can beensured that a decoder can receive a smooth video image that can bewatched. When the channel environment is good or channel resources areabundant, data of the enhancement layer may be transmitted to improve aframe rate, resolution, or video quality. The enhancement layer may bemulti-layer coded, which means that in a range of a total bit rate of avideo bitstream, a higher received bit rate indicates better videoquality. The electronic device 100 may further negotiate a transmissionperiod with the display device 200, for example, negotiate a VSP.Specifically, the electronic device 100 sends, to the display device 200through a Wi-Fi unicast frame, a negotiation parameter that carries theVSP. In addition, the electronic device 100 may further periodicallyperform receiving and sending synchronization with the display device200, to ensure VSP synchronization at both ends. For example, a timingsynchronization function (timing synchronization function, TSF)mechanism is used to ensure time synchronization between the electronicdevice 100 and the display device 200. Specifically, the electronicdevice 100 needs to periodically send a beacon (beacon) frame, and thedisplay device 200 needs to be periodically woken up to receive thebeacon frame. For example, the display device 200 initializes a TSFtimer, uses the beacon frame to notify another electronic device 100 oflocal time of the display device 200, and sets a time stamp for sendingthe beacon frame, to implement receiving and sending synchronization.The electronic device 100 may further transmit scalable video codingdata of a slice within a corresponding time period in the VSP (coding 1to coding 3 are respectively transmitted in time periods VSP1 to VSP3 asshown in FIG. 3 ) through transmission control, and guides, withreference to the channel state, coding by the electronic device 100 onthe slice. A function of the display device 200 is as follows: Thedisplay device 200 can negotiate the transmission period with theelectronic device 100, receive the scalable video coding data of theslice in a negotiated VSP through transmission control, and perform datapacket reordering on the scalable video coding data of the slice (forexample, perform data packet reordering based on a Wi-Fi data packetsequence number (seq), and discard a packet that fails to betransmitted). The display device 200 can perform sending and receivingsynchronization with the electronic device 100 based on the foregoingsending and receiving synchronization mechanism. The display device 200can also perform slice-level scalable video decoding on reordered datapackets with reference to the channel state (as shown in FIG. 3 ,received coding starts to be decoded in VSP2), perform data merging, andfinally display a video frame on the screen. In this embodiment of thisapplication, the electronic device 100 may further negotiate at leastone another time period (a VSP retry, or referred to as a videotransmission period in a retry mechanism) after the first time periodwith the display device 200. In addition, the electronic device 100 mayfurther reconstruct, after the at least one another time period, areference frame based on a successfully transmitted portion of ascalable video coding slice. It may be understood that the referenceframe is a reference object based on which P-frame coding is used for asubsequent transmitted video frame of the second video frame. Forexample, usually, when P-frame coding is performed on a 1^(st) slice ofa subsequent third video frame with reference to scalable video codingof a 1^(st) slice of the second video frame, one or more layers of thescalable video coding of the 1^(st) slice of the second video frame mayfail to be completely transmitted in corresponding time periods. In thiscase, scalable video coding is performed on the 1^(st) slice of thethird video frame with reference to the scalable video coding of the1^(st) slice of the second video frame. This may result in that thedisplay device 200 cannot correctly perform decoding. Therefore, in thisembodiment of this application, the electronic device 100 reconstructsthe video frame with reference to a successfully transmitted portion ofthe scalable video coding of the 1^(st) slice of the second video frame,and uses the reconstructed video frame as a reference object forperforming scalable video coding on the 1^(st) slice of the third videoframe.

For example, the electronic device 100 includes a terminal device thathas an image display function, such as a mobile phone, a tabletcomputer, a laptop computer, an ultra-mobile personal computer(ultra-mobile personal computer, UMPC), a netbook, a personal digitalassistant (personal digital assistant, PDA), an in-vehicle device, auser terminal (user terminal, UT), a terminal device (user device, UD),user equipment (user equipment, UE), or an artificial intelligence(artificial intelligence, AI) device. A specific type of the electronicdevice 100 is not limited in this embodiment of this application.

The display device 200 includes, for example, a terminal device that canimplement a large-screen display function, such as a laptop computer, alarge-screen display device (such as a smart screen), a projectiondevice, an AI device, or a tablet computer. A specific type of thedisplay device 200 is not limited in this embodiment of thisapplication.

Optionally, the electronic device 100 and the display device 200 in thisembodiment of this application may be implemented by different devices.For example, the electronic device 100 and the display device 200 inthis embodiment of this application may be implemented by using awireless projection apparatus in FIG. 4 . As shown in FIG. 4 , thewireless projection apparatus 200 includes at least one processor 201, acommunication line 202, a memory 203, and at least one communicationinterface 204. The memory 203 may alternatively be included in theprocessor 201.

The processor 201 may be a central processing unit (central processingunit, CPU), or may be another general-purpose processor, a digitalsignal processor (digital signal processor, DSP), anapplication-specific integrated circuit (application-specific integratedcircuit, ASIC), a field programmable gate array (field programmable gatearray, FPGA), or another programmable logic device, a discrete gate or atransistor logic device, a discrete hardware component, or the like. Thegeneral-purpose processor may be a microprocessor, or the processor maybe any conventional processor or the like.

The communication line 202 may be a circuit connecting the foregoingcomponents to each other and transmitting information between theforegoing components.

The communication interface 204 is configured to communicate withanother device. In embodiments of this application, the communicationinterface 204 may be a module, a circuit, a bus, an interface, atransceiver, or another apparatus that can implement a communicationfunction, and is configured to communicate with another device.Optionally, when the communication interface 204 is the transceiver, thetransceiver may be an independently disposed transmitter, and thetransmitter may be configured to send information to another device.Alternatively, the transceiver may be an independently disposedreceiver, and is configured to receive information from another device.Alternatively, the transceiver may be a component integrating functionsof sending and receiving information. A specific implementation of thetransceiver is not limited in embodiments of this application.

The memory 203 may be a volatile memory or a nonvolatile memory, or mayinclude both a volatile memory and a nonvolatile memory. The nonvolatilememory may be a read-only memory (read-only memory, ROM), a programmableread-only memory (programmable ROM, PROM), an erasable programmableread-only memory (erasable PROM, EPROM), an electrically erasableprogrammable read-only memory (electrically EPROM, EEPROM), or a flashmemory. The volatile memory may be a random access memory (random accessmemory, RAM), used as an external cache. By way of example but notlimitation, many forms of RAM are available, for example, static randomaccess memory (static RAM, SRAM), dynamic random access memory (dynamicRAM, DRAM), synchronous dynamic random access memory (synchronous DRAM,SDRAM), double data rate synchronous dynamic random access memory(double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic randomaccess memory (enhanced SDRAM, ESDRAM), synchlink dynamic random accessmemory (synchlink DRAM, SLDRAM) and direct rambus random access memory(direct rambus RAM, DR RAM), or other magnetic storage devices, or anyother medium that can be for carrying or storing expected program codein a form of instructions or a data structure and that can be accessedby a computer, but is not limited thereto. The memory 203 may existindependently, and be connected to the processor 201 by using thecommunication line 202. The memory 203 may alternatively be integratedwith the processor 201.

The memory 203 is configured to store computer-executable instructionsfor implementing the solutions of this application, and the processor201 controls the execution. The processor 201 is configured to executethe computer-executable instructions stored in the memory 203, toimplement a determining parameter determining method provided in thefollowing embodiments of this application.

It should be noted that the memory described in this specification aimsto include but is not limited to these memories and any memory ofanother proper type.

Optionally, the computer-executable instructions in embodiments of thisapplication may also be referred to as application program code,instructions, a computer program, or another name. This is notspecifically limited in embodiments of this application.

During specific implementation, in an embodiment, the processor 201 mayinclude one or more CPUs, for example, a CPU 0 and a CPU 1 in FIG. 4 .

During specific implementation, in an embodiment, the wirelessprojection apparatus 200 may include a plurality of processors, forexample, the processor 201 and a processor 207 in FIG. 4 . Each of theprocessors may be a single-core (single-CPU) processor, or may be amulti-core (multi-CPU) processor. The processor herein may be one ormore devices, circuits, and/or processing cores configured to processdata (for example, computer program instructions).

During specific implementation, in an embodiment, the wirelessprojection apparatus 200 may further include an output device 205 and aninput device 206. The output device 205 communicates with the processor201, and may display information in a plurality of manners. For example,the output device 205 may be a liquid crystal display (liquid crystaldisplay, LCD), a light emitting diode (light emitting diode, LED)display device, a cathode ray tube (cathode ray tube, CRT) displaydevice, or a projector (projector). The input device 206 communicateswith the processor 201, and may receive an input from a user in aplurality of manners. For example, the input device 206 may be a mouse,a keyboard, a touchscreen device, or a sensor device.

It should be noted that the wireless projection apparatus 200 may be ageneral-purpose device or a dedicated device. A type of the apparatus isnot limited in this embodiment of this application. A structure of thewireless projection apparatus 200 in FIG. 4 does not constitute alimitation on the wireless projection apparatus. An actual wirelessprojection apparatus may include more or fewer components than those inthe figure, or combine some components, or have different componentarrangement. The components in the figure may be implemented byhardware, software, or a combination of software and hardware.

The following describes in detail, with reference to the accompanyingdrawings, the wireless projection method provided in embodiments of thisapplication by using an example in which an electronic device is amobile phone and a display device is a radio television set. FIG. 5 is aschematic flowchart of a wireless projection method according to anembodiment of this application. As shown in FIG. 5 , the method mayinclude the following steps.

S501: A mobile phone establishes a Wi-Fi connection to a radiotelevision set.

The mobile phone and the radio television set may establish the Wi-Ficonnection by using a Wi-Fi P2P protocol. To establish the Wi-Ficonnection between terminals, each terminal needs to have a transmissioncapability. In addition, the terminals need to know connectioninformation about each other. The connection information may be a deviceidentifier of the terminal, for example, an internet protocol (internetprotocol, IP) address, a port number, or an account logged in on theterminal. The account logged in on the terminal may be an accountprovided by an operator for a user. The account logged in on theterminal may alternatively be an application account or the like. Thetransmission capability that the terminal has may be a near fieldcommunication capability, or may be a long-distance communicationcapability. To be specific, a wireless communication protocol used forestablishing a connection between terminals, for example, a mobile phoneand a radio television set, may be a near field communication protocolsuch as a Wi-Fi protocol, a Bluetooth protocol, or an NFC protocol, ormay be a cellular network protocol. For example, the user may use themobile phone to touch an NFC tag of the radio television set, and themobile phone reads connection information stored in the NFC tag. Forexample, the connection information includes an IP address of the radiotelevision set. Then, the mobile phone may establish, based on the IPaddress of the radio television set, the connection to the radiotelevision set by using another protocol, for example, a Wi-Fi protocolFor another example, Bluetooth functions and Wi-Fi functions are enabledon both the mobile phone and the radio television set. The mobile phonemay broadcast a Bluetooth signal, to discover a surrounding terminal.For example, the mobile phone may display a discovered device list. Thediscovered device list may include an identifier of a device discoveredby the mobile phone, for example, include an identifier of the radiotelevision set. In a process of discovering a device, the mobile phonemay also exchange the connection information, for example, the IPaddress, with a discovered device. Then, after the mobile phone receivesan operation of selecting the identifier of the radio television setfrom the device list displayed by the user, the mobile phone mayestablish, based on the IP address of the radio television set, theconnection to the radio television set by using the Wi-Fi protocol.

S502: The mobile phone negotiates a projection parameter with the radiotelevision set.

For example, the mobile phone may negotiate the projection parameter bysending a Wi-Fi unicast frame to the radio television set. Specifically,the Wi-Fi unicast frame may carry a VSP, a VSP retry, and delay (delay)time of projection starting. A time period in the VSP is mainly forfirst transmission of a scalable video coding slice of a data slice in avideo frame, and a time period in the VSP retry is mainly forre-transmission of a portion that is of the scalable video coding sliceof the data slice in the video frame and that is discarded in the timeperiod in the VSP. The time period in the VSP retry has a same length asthe time period in the VSP. The delay time of projection starting is forprojection start time agreed by both ends.

S503: The mobile phone transmits a scalable video coding slice of afirst video frame to the radio television set in a first videotransmission period.

One scalable video coding slice of the first video frame may becorrespondingly transmitted in one time period in the first videotransmission period. First, the mobile phone needs to perform scalablevideo coding on a plurality of data slices of the video frame insequence to generate a plurality of scalable video coding slices. Referto FIG. 3 . The mobile phone performs scalable video coding on a firstdata slice of the first video frame to generate the first scalable videocoding slice (for example, coding 1), and the mobile phone performsscalable video coding on a second data slice of the first video frame togenerate a second scalable video coding slice (for example, coding 2).In this way, a plurality of data slices of the first video frame arecoded into a plurality of scalable video coding slices in sequence. Fora scalable video coding scheme of another video frame, reference may bemade to descriptions of the first video frame. It should be noted thatscalable video coding for any slice needs to be completed before a timeperiod in a video transmission period in which the slice is transmittedarrives. For example, if the first video transmission period of thefirst video frame includes four time periods, namely, VSP1 to VSP4,coding 1 needs to be completed in VSP0 before VSP1, and coding 2 needsto be completed in VSP1 before VSP2. In this way, the coding 1 can betransmitted in corresponding VSP1 and the coding 2 can be transmitted inVSP2. Specifically, for the first video frame transmitted by the mobilephone for a first time, because the first video frame can be transmittedonly after the coding 1 is completed, data transmission is not performedbefore VSP1 (for example, VSP0). For the first video frame in atransmission process of the mobile phone, for example, there is anothervideo frame before the first video frame, a scalable video coding sliceof a data slice of another video frame before the first video frame maybe transmitted in VSP0. In this embodiment, if VSP0 is empty, it onlyindicates that the data slice of the first video frame is nottransmitted. It may be understood that, after the scalable video codingis performed on the data slice, the coding 1 may include layers ofdifferent quality, resolution, or frame speeds, for example, a basiclayer, a first enhancement layer, a second enhancement layer, and thelike. Refer to FIG. 3 . The mobile phone transmits the generated coding1 in VSP1 after VSP0. It should be noted that, in VSP1, the mobile phonemay perform QoS (quality of service, quality of service) control. Forexample, because the coding 1 includes the basic layer, the firstenhancement layer, the second enhancement layer, and the like, the basiclayer and the at least one enhancement layer may be transmitted insequence based on transmission priorities of the layers.

S504: The mobile phone obtains channel state information that is fedback by the radio television set and that is for transmitting the firstvideo frame.

The mobile phone transmits the coding 1, the coding 2, ..., and the likein sequence in the time periods VSP1, VSP2, ..., and the like in FIG. 3. The radio television set may feed back, to the mobile phone after eachtime period, channel state information for transmitting a correspondingscalable video coding slice, for example, feed back, to the mobile phoneafter VSP1, channel state information for transmitting the coding 1. Thechannel state information may include a total quantity of data packetscorresponding to coding of each slice and a quantity of data packetsthat are successfully transmitted in a corresponding time period, forexample, a total quantity of data packets of the coding 1 and a quantityof data packets (excluding a data packet that is successfullytransmitted after a data packet that fails to be transmitted) that areof the coding 1 and that are successfully transmitted in VSP1. Themobile phone and the radio television set may use a blockacknowledgement (block acknowledgement, block ACK) mechanism todetermine whether a data packet is successfully transmitted. Forexample, after receiving a series of data packets sent by the mobilephone, the radio television set correspondingly feeds back a block ACK,and the mobile phone determines, by using a bitmap (bitmap) in the blockACK, the quantity of data packets that are successfully transmitted. Inan optional solution, the radio television set may alternativelytransmit feedback information about receiving of the slice for the sliceto the mobile phone, and the mobile phone determines the channel stateinformation based on the feedback information about receiving of theslice. The electronic device may selectively enable a retry mechanismbased on the channel state information. For example, the electronicdevice may determine channel quality based on the channel stateinformation. When the channel quality is lower than a quality threshold,the electronic device determines that the channel quality is poor, andenables the retry mechanism; or when the channel quality is higher thanor equal to a quality threshold, the electronic device determines thatthe channel state is good, and does not enable the retry mechanism; orwhen the retry mechanism is already enabled, the electronic devicedisables the retry mechanism when determining that the channel state isgood. The quality threshold may be a quantity threshold set forsuccessfully transmitted data packets, or a reference threshold set fora proportion of a quantity of successfully transmitted data packets in atotal quantity of data packets corresponding to coding. For example,when the channel state is poor, the quantity of successfully transmitteddata packets is less than a specific quantity threshold, or theproportion of the quantity of successfully transmitted data packets isless than the reference threshold. When the channel state is good, thequantity of successfully transmitted data packets is greater than orequal to the specific quantity threshold, or the proportion of thequantity of successfully transmitted data packets is greater than orequal to the reference threshold. The retry mechanism is to perform stepS506.

S505: The radio television set decodes the scalable video coding slicetransmitted by the mobile phone in the first video transmission period.

Specifically, after the coding 1 is transmitted to the radio televisionset in VSP1, the radio television set starts to decode, after VSP1 (forexample, in VSP2), the scalable video coding slice received in VSP1.

S506: The mobile phone transmits the first scalable video coding sliceof a second video frame to the radio television set in a first timeperiod in a second video transmission period, and transmits, to theradio television set in at least one another time period after the firsttime period, a portion that is of the first scalable video coding sliceand that is discarded in the first time period. One another scalablevideo coding slice of the second video frame is transmitted in at leastone another time period.

As shown in FIG. 6 , the second video frame is transmitted in the secondvideo transmission period (including time periods, namely, VSP5, VSP6,VSP7, and VSP8). With reference to the foregoing descriptions, themobile phone transmits coding 5, coding 6, ..., and the like in sequencein the time periods VSP5, VSP6, ..., and the like in FIG. 6 . In VSP5,the mobile phone may perform QoS (quality of service, quality ofservice) control. For example, because the coding 5 includes a basiclayer, a first enhancement layer, a second enhancement layer, and thelike, the basic layer and the at least one enhancement layer may betransmitted in sequence based on transmission priorities of the layers.Specifically, if transmission of the coding 5 is not completed in VSP5in step S504, that is, there is a portion of the coding 5 that isdiscarded in VSP5, the portion of the coding 5 whose transmission is notcompleted is retransmitted in a time period VSP1 re1 (retry1,retransmission for a first time) after VSP5. Specifically, the coding 5includes coded data of a plurality of layers, for example, the basiclayer and the at least one enhancement layer. In step S506, if both thebasic layer and the at least one enhancement layer of the coding 5 arediscarded in VSP5 (that is, transmission of both the basic layer and theat least one enhancement layer is not completed), the basic layer andthe at least one enhancement layer of the coding 5 are transmitted inVSP1 re1. If transmission of the basic layer of the coding 5 iscompleted in VSP5 and the at least one enhancement layer is discarded inVSP5, the at least one enhancement layer of the coding 5 is transmittedin VSP1 re1. Before step S505, the VSP retry may not be enabled bydefault. To be specific, for each video frame, the mobile phonetransmits the coding 1, the coding 2, ..., and the like in sequence inthe time periods VSP1, VSP2, ..., and the like with reference to FIG. 3. After the VSP retry is enabled based on the channel state information,for a subsequent video frame, for example, the second video frame inFIG. 6 , the coding 5, the coding 6, ..., and the like are transmittedin sequence in the time periods VSP5, VSP6, ..., and the like, andportions that are of the coding 5, the coding 6, ..., and the like andthat are discarded in corresponding time periods VSP5, VSP6, ..., andthe like are retransmitted in VSP1 re1, VSP2 re2, ..., and the like. Inaddition, based on a negotiation result in step S502, the coding 5, thecoding 6, ..., and the like may alternatively be retransmitted for aplurality of times. For example, if the coding 5 still has a discardedportion (the transmission is not completed) after being transmitted inVSP1 and VSP1 re1, the coding 5 may be retransmitted in a time periodVSP1 re2 following VSP1 re1. With reference to FIG. 6 , two VSPs areincluded. The VSP (VSP5, VSP6, ..., and the like) is mainly used totransmit the coding 5, the coding 6, ..., and the like in sequence. Theportions that are of the coding 5, the coding 6, ..., and the like andthat are discarded in corresponding time periods VSP5, VSP6, ..., andthe like are retransmitted in the VSP retry (VSP1 re1, VSP2 re2, ...,and the like), and in the time period (VSP7/VSP2 re1) after VSP1 re1,the radio television set decodes the received coding 5 to decoding 5. Inthis case, the feedback of the channel state information is delayed forone VSP (feedback of a channel state is delayed after VSP6). Inaddition, the electronic device may re-determine, based on the channelstate information, whether to enable the retry mechanism in a subsequentvideo transmission period. A quantity of VSP retries may alternativelybe configured to be more. For example, in FIG. 7 , the quantity of VSPretries is configured to be 2. It may be understood that a largerquantity of VSP retries indicates a larger opportunity of fulltransmission of the coding 5, and indicates a strongeranti-instantaneous interference capability, and more coding buffers(buffers) are needed. After the VSP retry is enabled, QoS flow controlis jointly performed on different priorities of different layers of aslice. For example, when a quantity of VSP retries is 1, there are twoVSP (a VSP and a VSP retry) transmission periods at a specific moment,corresponding to a VSP retry period of a previous slice and a VSP periodof a current slice. In the VSP6 period, there is an opportunity totransmit data that is of the coding 5 and that is not successfullytransmitted in VSP5. In an example, in VSP6, a transmission priority ofa basic layer of the first scalable video coding slice (the coding 5) ofthe second video frame is higher than a transmission priority of a basiclayer of the second scalable video coding slice (the coding 6), thetransmission priority of the basic layer of the second scalable videocoding slice (the coding 6) is higher than a transmission priority of anenhancement layer of the first scalable video coding slice (the coding5), and the transmission priority of the enhancement layer of the firstscalable video coding slice (the coding 5) is higher than a transmissionpriority of an enhancement layer of the second scalable video codingslice (the coding 6). Specifically, it is assumed that, in VSP5, a basiclayer 1 of the coding 5 is transmitted successfully, and an enhancementlayer 2 and an enhancement layer 3 of the coding 5 are not transmittedsuccessfully. In VSP6, the transmission priorities of the layers indescending order are: a transmission priority of the basic layer 1 ofthe coding 5, a transmission priority of a basic layer 1 of the coding6, a transmission priority of the enhancement layer 2 of the coding 5, atransmission priority of an enhancement layer 2 of the coding 6, atransmission priority of the enhancement layer 3 of the coding 5, atransmission priority of an enhancement layer 3 of the coding 6, ...,and the like.

In addition, after the at least one another time period, a referenceframe is reconstructed based on a successfully transmitted portion ofthe first scalable video coding slice, and first scalable video codingof a third video frame is generated based on the reference frame. Referto FIG. 6 . After VSP6 (VSP1 re1), the mobile phone reconstructs areference frame 1 based on the successfully transmitted portion of thecoding 5, and performs, in VSP8 based on the reference frame 1, scalablevideo coding on a first data slice of the third video frame to generatecoding 9. The third video frame is located after the second video frame.It may be understood that the reference frame 1 is a reference objectbased on which P-frame coding is used for the subsequent transmittedthird video frame of the second video frame. For example, usually, whenP-frame coding is performed on coding 9 of the subsequent third videoframe with reference to the coding 5 of the second video frame, one ormore layers of the coding 5 may fail to be completely transmitted incorresponding VSP5 and VSP6. In this case, the coding 9 of the thirdvideo frame is generated with reference to the coding 5. This may resultin that the radio television set cannot correctly perform decoding. Inthis embodiment of this application, dynamic reference framereconstruction is designed. The mobile phone reconstructs the referenceframe 1 with reference to the successfully transmitted portion of thecoding 5 of the second video frame, and uses the reconstructed videoframe 1 as a reference object for generating the coding 9 of the thirdvideo frame. For example, the mobile phone reconstructs the referenceframe with reference to only a basic layer that is successfullytransmitted. As shown in FIG. 6 , when the quantity of VSP retries is 1,the reference frame 1 is reconstructed for a delay of one VSP(reconstructed after VSP6/VSP1 re1). In this case, that P-frame codingis subsequently performed on the subsequent coding 9 based on adynamically reconstructed reference frame 5 is not affected. Incombination with bit rate control of the mobile phone, an amount of datato be coded can be significantly reduced, and the anti-interferencecapability during transmission can be enhanced. FIG. 6 and FIG. 7 areboth described by using an example in which one video frame is dividedinto four slices. However, as shown in FIG. 7 , when the quantity of VSPretries is 2 or greater than 2, because transmission of the coding 5 iscompleted and the channel state information is fed back in VSP7, themobile phone cannot generate a reference frame of the coding 9 in time.In this case, the mobile phone may perform inter-frame reference, forexample, generate the reference frame 1 in VSP11, to refer to thereference frame 1 when coding 13 is generated in a next fourth videoframe. Specifically, in this embodiment of this application, a quantityof divided slices of each video frame and the quantity of VSP retriesare not limited. Specifically, the quantity of slices and the quantityof VSP retries may be dynamically adjusted based on the channel stateinformation and negotiation in step S502 with consideration of a delayand anti-interference performance.

S507: The radio television set decodes the first scalable video codingslice of the second video frame transmitted by the mobile phone in thefirst time period and a portion that is of the first scalable videocoding slice and that is discarded in the first time period and that istransmitted in the at least one another time period after the first timeperiod.

Correspondingly, before step S507, the radio television set receives thefirst scalable video coding slice of the second video frame transmittedby the mobile phone in the first time period in the second videotransmission period, and receives the portion that is of the firstscalable video coding slice and that is discarded in the first timeperiod and that is transmitted by the mobile phone in the at least oneanother time period after the first time period. One another scalablevideo coding slice of the second video frame is transmitted in at leastone another time period. In addition, it should be noted that thescalable video coding slice includes one basic layer and at least oneenhancement layer. Specifically, the radio television set receives abasic layer and at least one enhancement layer of the first scalablevideo coding slice of the second video frame that are transmitted by themobile phone in the first time period in the second video transmissionperiod based on transmission priorities of the basic layer and the atleast one enhancement layer of the first scalable video coding slice. Inaddition, when transmission of the basic layer and the at least oneenhancement layer of the first scalable video coding slice of the secondvideo frame is not completed in the first time period, the mobile phonereceives the basic layer and the at least one enhancement layer of thefirst scalable video coding slice transmitted by the radio televisionset in the at least one another time period after the first time period.When transmission of the at least one enhancement layer of the firstscalable video coding slice of the second video is not completed in thefirst time period, the mobile phone receives the at least oneenhancement layer of the first scalable video coding slice transmittedby the radio television set in the at least one another time periodafter the first time period. Refer to FIG. 6 . The radio television setrespectively receives, in VSP5, the coding 1 transmitted by the mobilephone, and receives, in VSP6, the portion that is discarded when themobile phone transmits the coding 5 in VSP5, and decodes the coding 1received in VSP5 and VSP6 and displays the coding 1 on a screen.

In this way, in the foregoing solution, the mobile phone can firsttransmit a scalable video coding slice of a video frame in a videotransmission period, for example, transmit one scalable video codingslice in a time period in a video transmission period in an initialstate. Certainly, if transmission of the scalable video coding slice isnot completed in a corresponding time period, the scalable video codingslice is directly discarded. Then, the mobile phone obtains the channelstate information that is fed back by the radio television set and thatis for transmitting any scalable video coding slice of the first videoframe. For example, after each time period, the channel stateinformation for transmitting the scalable video coding slice in the timeperiod may be obtained. It may be understood that the channel stateinformation may reflect a portion that is of the scalable video codingslice and that is discarded in the corresponding time period. Forexample, the channel state may be a total quantity of data packets ofthe scalable video coding slice transmitted in one time period and aquantity of data packets that are successfully transmitted. In this way,the mobile phone may selectively enable the retry mechanism based on thechannel state information. For example, if the mobile phone determines,based on the channel state information, that the channel quality ispoor, the mobile phone enables the retry mechanism; or when the channelquality is good, the mobile phone does not enable the retry mechanism;or when the retry mechanism is already enabled, the mobile phonedisables the retry mechanism when determining that the channel qualityis good. The retry mechanism is that the mobile phone transmits onescalable video coding slice in a plurality of time periods in asubsequent video transmission period, for example, transmits a firstscalable video coding slice of another video frame to the display devicein a first time period in a subsequent video transmission period, andtransmits, to the display device in at least one another time periodafter the first time period, a portion that is of the first scalablevideo coding slice and that is discarded in the first time period. Oneanother scalable video coding slice of the second video frame istransmitted in the at least one another time period. In this way, whenone scalable video coding slice has a discarded portion in acorresponding time period, the discarded portion may be transmitted inanother time period. For example, when transmission of one or more of abasic layer and at least one enhancement layer of a scalable videocoding slice of a slice is not completed in a corresponding time period,the basic layer and the at least one enhancement layer have anopportunity of being transmitted in a next time period. In this way, theradio television set may perform decoding with reference to the firstscalable video coding slices transmitted in the two time periods, toensure successful transmission of the scalable video coding slice asmuch as possible on the premise that a portion of a delay is sacrificed,reduce image tearing and freezing and image quality deteriorationoccurring in wireless projection, and improve user experience. Inaddition, after the at least one another time period, a reference frameis reconstructed based on the successfully transmitted portion of thefirst scalable video coding slice, and the first scalable video codingof the third video frame is generated based on the reference frame. Inthis way, when the electronic device transmits the third video frame,for the first scalable video coding slice of the second video frame,reference may be made to portions that are successfully transmitted inthe first time period and the at least one another time period after thefirst time period. In this way, formed inter-predictive frame(predictive frame, P frame for short) coding can reduce an amount ofdata to be coded, and help ensure that the third video frame of theelectronic device can be decoded based on an actually successfullytransmitted portion after being transmitted to the display device.

It may be understood that, to implement the foregoing functions, themobile phone and the radio television set include corresponding hardwarestructures and/or software modules for performing the functions. Aperson skilled in the art should be easily aware that, in combinationwith units and algorithm operations of the examples described inembodiments disclosed in this specification, this application can beimplemented by hardware or a combination of hardware and computersoftware. Whether a function is performed by hardware or hardware drivenby computer software depends on particular applications and designconstraints of the technical solutions. A person skilled in the art mayuse different methods to implement the described functions for eachparticular application, but it should not be considered that theimplementation goes beyond the scope of this application.

In embodiments of this application, the mobile phone may be divided intofunctional modules based on the foregoing method examples. For example,each functional module may be divided based on each function, or two ormore functions may be integrated into one processing module. Theintegrated module may be implemented in a form of hardware, or may beimplemented in a form of a software functional module. It should benoted that, in embodiments of this application, module division is anexample, and is merely a logical function division. In actualimplementation, another division manner may be used.

For example, when each functional module is divided in an integratedmanner, FIG. 8 is a schematic diagram of a structure of a wirelessprojection apparatus 80. The wireless projection apparatus 80 may be achip or a system on chip in the foregoing mobile phone, or anothercombined device, component, or the like that can implement a function ofthe foregoing mobile phone. The wireless projection apparatus 80 may beconfigured to perform the function of the mobile phone in the foregoingembodiments.

In a possible implementation, the wireless projection apparatus 80 inFIG. 8 includes a sending unit 801, a processing unit 802, and areceiving unit 803. The sending unit 801 is configured to transmit ascalable video coding slice of a first video frame to a display devicein a first video transmission period. The receiving unit 803 isconfigured to obtain channel state information that is fed back by thedisplay device and that is for transmitting the first video frame. Theprocessing unit 802 is configured to selectively enable a retrymechanism based on the channel state information obtained by thereceiver. The retry mechanism is that the sending unit 801 is furtherconfigured to: transmit a first scalable video coding slice of a secondvideo frame to the display device in a first time period in a secondvideo transmission period, and transmit, to the display device in atleast one another time period after the first time period, a portionthat is of the first scalable video coding slice and that is discardedin the first time period. One another scalable video coding slice of thesecond video frame is transmitted in the at least one another timeperiod.

Optionally, the scalable video coding slice includes one basic layer andat least one enhancement layer; and the sending unit 801 is specificallyconfigured to transmit the basic layer and the at least one enhancementlayer of the first scalable video coding slice of the second video frameto the display device in the first time period in the second videotransmission period based on transmission priorities of the basic layerand the at least one enhancement layer of the first scalable videocoding slice of the second video frame.

Optionally, the scalable video coding slice includes the one basic layerand the at least one enhancement layer, the at least one another timeperiod includes a second time period in the second video transmissionperiod, and the another scalable video coding slice includes a secondscalable video coding slice of the second video frame. The sending unit801 is specifically configured to transmit, to the display device in thesecond time period based on the transmission priorities of the basiclayer and the at least one enhancement layer of the first scalable videocoding slice and transmission priorities of a basic layer and at leastone enhancement layer of the second scalable video coding slice, theportion that is of the first scalable video coding slice and that isdiscarded and the second scalable video coding slice. The transmissionpriority of the basic layer of the first scalable video coding slice ishigher than the transmission priority of the basic layer of the secondscalable video coding slice, the transmission priority of the basiclayer of the second scalable video coding slice is higher than thetransmission priority of the enhancement layer of the first scalablevideo coding slice, and the transmission priority of the enhancementlayer of the first scalable video coding slice is higher than thetransmission priority of the enhancement layer of the second scalablevideo coding slice.

Optionally, the discarded portion of the first scalable video codingslice includes the basic layer and the at least one enhancement layer ofthe first scalable video coding slice; and the sending unit 801 isspecifically configured to transmit the basic layer and the at least oneenhancement layer of the first scalable video coding slice to thedisplay device in the at least one another time period after the firsttime period.

Optionally, the discarded portion of the first scalable video codingslice includes the at least one enhancement layer of the first scalablevideo coding slice; and the sending unit 801 is specifically configuredto transmit the at least one enhancement layer of the first scalablevideo coding slice to the display device in the at least one anothertime period after the first time period.

Optionally, the processing unit 802 is further configured to: after theat least one another time period, reconstruct a reference frame based ona successfully transmitted portion of the first scalable video codingslice; and generate the first scalable video coding of the third videoframe based on the reference frame.

All related content of the operations in the foregoing methodembodiments may be cited in function descriptions of the correspondingfunctional modules. Details are not described herein again.

In this embodiment, the wireless projection apparatus 80 is presented ina form of functional modules divided in an integrated manner. The moduleherein may be an ASIC, a circuit, a processor that executes one or moresoftware or firmware programs, a memory, an integrated logic circuit,and/or another component capable of providing the foregoing functions.In a simple embodiment, a person skilled in the art may figure out thatthe wireless projection apparatus 80 may be in the form in FIG. 4 .

For example, the processor 201 may invoke the computer-executableinstructions stored in the memory 203 in FIG. 4 , to enable the wirelessprojection apparatus to perform the wireless projection method in theforegoing method embodiments.

For example, functions/implementation processes of the sending unit 801,the processing unit 802 and the receiving unit 803 in FIG. 8 may beimplemented by the processor 201 by invoking the computer-executableinstructions stored in the memory 203 in FIG. 4 . Alternatively,functions/implementation processes of the processing unit 802 in FIG. 8may be implemented by the processor 201 by invoking thecomputer-executable instructions stored in the memory 203 in FIG. 4 ,and functions/implementation processes of the sending unit 801 in FIG. 8may be implemented by the transmitter in the communication interface 204in FIG. 4 . The functions/implementation processes of the receiving unit803 in FIG. 8 may be implemented by the receiver in the communicationinterface 204 in FIG. 4 .

The wireless projection apparatus 80 provided in this embodiment mayperform the wireless projection method. Therefore, for technical effectsthat can be achieved by the wireless projection apparatus 80, refer tothe foregoing method embodiments. Details are not described hereinagain.

In embodiments of this application, the radio television set may bedivided into functional modules based on the foregoing method examples.For example, each functional module may be divided based on eachfunction, or two or more functions may be integrated into one processingmodule. The integrated module may be implemented in a form of hardware,or may be implemented in a form of a software functional module. Itshould be noted that, in embodiments of this application, moduledivision is an example, and is merely a logical function division. Inactual implementation, another division manner may be used.

For example, when each functional module is divided in an integratedmanner, FIG. 9 is a schematic diagram of a structure of a wirelessprojection apparatus 90. The wireless projection apparatus 90 may be achip or a system on chip in the foregoing radio television set, oranother combined device, component, or the like that can implement afunction of the foregoing radio television set. The wireless projectionapparatus 90 may be configured to perform the function of the radiotelevision set in the foregoing embodiments.

In a possible implementation, the wireless projection apparatus 90 inFIG. 9 includes a receiving unit 901, a processing unit 902, and asending unit 903. The receiving unit 901 is configured to receive ascalable video coding slice of a first video frame that is transmittedby an electronic device to the display device in a first videotransmission period. The sending unit 903 is configured to feed back, tothe electronic device, channel state information for transmitting thefirst video frame. The electronic device selectively enables a retrymechanism based on the channel state information. The processing unit902 is configured to decode the scalable video coding slice transmittedby the electronic device in the first video transmission period. Thereceiving unit 901 is further configured to receive a first scalablevideo coding slice of a second video frame transmitted by the electronicdevice in a first time period in a second video transmission period inthe retry mechanism; and receive a portion that is of the first scalablevideo coding slice and that is discarded in the first time period andthat is transmitted by the electronic device in at least one anothertime period after the first time period. One another scalable videocoding slice of the second video frame is transmitted in the at leastone another time period. The processing unit 902 is further configuredto decode the first scalable video coding slice of the second videoframe transmitted by the electronic device in the first time period andthe portion that is of the first scalable video coding slice and that isdiscarded in the first time period and that is transmitted in the atleast one another time period after the first time period.

Alternatively, the scalable video coding slice includes one basic layerand at least one enhancement layer; and the receiving unit 901 isspecifically configured to receive the basic layer and the at least oneenhancement layer of the first scalable video coding slice of the secondvideo frame that are transmitted by the electronic device in the firsttime period in the second video transmission period based ontransmission priorities of the basic layer and the at least oneenhancement layer of the first scalable video coding slice.

Optionally, the scalable video coding slice includes the one basic layerand the at least one enhancement layer; and the receiving unit 901 isspecifically configured to receive the basic layer and the at least oneenhancement layer of the first scalable video coding slice that aretransmitted by the electronic device in the at least one another timeperiod after the first time period.

Optionally, the scalable video coding slice includes the one basic layerand the at least one enhancement layer; and the receiving unit 901 isspecifically configured to receive the at least one enhancement layer ofthe first scalable video coding slice transmitted by the electronicdevice in the at least one another time period after the first timeperiod.

All related content of the operations in the foregoing methodembodiments may be cited in function descriptions of the correspondingfunctional modules. Details are not described herein again.

In this embodiment, the wireless projection apparatus 90 is presented ina form of functional modules divided in the integrated manner. Themodule herein may be an ASIC, a circuit, a processor that executes oneor more software or firmware programs, a memory, an integrated logiccircuit, and/or another component capable of providing the foregoingfunctions. In a simple embodiment, a person skilled in the art mayfigure out that the wireless projection apparatus 90 may be in the formin FIG. 4 .

For example, the processor 201 may invoke the computer-executableinstructions stored in the memory 203 in FIG. 4 , to enable the wirelessprojection apparatus 90 to perform the wireless projection method in theforegoing method embodiments.

For example, functions/implementation processes of the receiving unit901, the processing unit 902 and the sending unit 903 in FIG. 9 may beimplemented by the processor 201 by invoking the computer-executableinstructions stored in the memory 203 in FIG. 4 . Alternatively,functions/implementation processes of the processing unit 902 in FIG. 9may be implemented by the processor 201 by invoking thecomputer-executable instructions stored in the memory 203 in FIG. 4 ,and functions/implementation processes of the receiving unit 901 in FIG.9 may be implemented by the receiver in the communication interface 204in FIG. 4 . The functions/implementation processes of the sending unit903 in FIG. 9 may be implemented by the transmitter in the communicationinterface 204 in FIG. 4 .

The wireless projection apparatus 90 provided in this embodiment mayperform the wireless projection method. Therefore, for technical effectsthat can be achieved by the wireless projection apparatus 90, refer tothe foregoing method embodiments. Details are not described hereinagain.

Optionally, an embodiment of this application further provides awireless projection apparatus (for example, the wireless projectionapparatus may be a chip or a chip system). The wireless projectionapparatus includes a processor and an interface, and the processor isconfigured to read instructions to perform the method in any one of theforegoing method embodiments. In a possible design, the wirelessprojection apparatus further includes a memory. The memory is configuredto store necessary program instructions and necessary data. The memorymay invoke program code stored in the memory, to instruct the wirelessprojection apparatus to perform the method in any one of the foregoingmethod embodiments. Certainly, the memory may alternatively not be inthe wireless projection apparatus. When the wireless projectionapparatus is a chip system, the wireless projection apparatus mayinclude a chip, or may include a chip and another discrete component.This is not specifically limited in embodiments of this application.

Specifically, when the wireless projection apparatus 80 in FIG. 8 is amobile phone, and the wireless projection apparatus 90 in FIG. 9 is aradio television set, the sending unit 801 and the sending unit 903 maybe transmitters during the information transmission, the receiving unit803 and the receiving unit 901 may be receivers during the informationtransmission, and the receiving unit may be a transceiver. Thetransceiver, the transmitter, or the receiver may be a radio frequencycircuit. When the wireless projection apparatus 80 in FIG. 8 and thewireless projection apparatus 90 in FIG. 9 include a storage unit, thestorage unit is configured to store the computer instructions, theprocessor is communicatively connected to the memory, and the processorexecutes the computer instruction stored in the memory, so that thewireless projection apparatus performs the method in the methodembodiments. The processor may be a general-purpose central processingunit (CPU), a microprocessor, or an application-specific integratedcircuit (application-specific integrated circuit, ASIC).

When the wireless projection apparatus in FIG. 8 and the wirelessprojection apparatus in FIG. 9 are chips, the sending unit 801, thesending unit 903, the receiving unit 803, and the receiving unit 901 maybe input and/or output interfaces, pins, circuits, or the like. Theprocessing unit 802 and the processing unit 902 may execute thecomputer-executable instructions stored in the storage unit, so that thewireless projection apparatus 80 in FIG. 8 and the chip in the wirelessprojection apparatus 90 in FIG. 9 perform the method in the methodembodiments. Optionally, the storage unit is a storage unit in the chip,for example, a register or a cache. Alternatively, the storage unit maybe a storage unit that is in the terminal device or the network deviceand that is located outside the chip, for example, a read-only memory(read-only memory, ROM) or another type of static storage device thatcan store static information and instructions, or a random access memory(random access memory, RAM).

All or a part of the foregoing embodiments may be implemented bysoftware, hardware, firmware, or any combination thereof. When asoftware program is used to implement embodiments, embodiments may beimplemented completely or partially in a form of a computer programproduct. The computer program product includes one or more computerinstructions. When the computer program instructions are loaded andexecuted on the computer, the procedure or functions according toembodiments of this application are all or partially generated. Thecomputer may be a general-purpose computer, a dedicated computer, acomputer network, or another programmable apparatus. The computerinstructions may be stored in a computer-readable storage medium or maybe transmitted from a computer-readable storage medium to anothercomputer-readable storage medium. For example, the computer instructionsmay be transmitted from a website, computer, server, or data center toanother website, computer, server, or data center in a wired (forexample, a coaxial cable, an optical fiber, or a digital subscriber line(digital subscriber line, DSL)) or wireless (for example, infrared,radio, or microwave) manner. The computer-readable storage medium may beany usable medium accessible by a computer, or a data storage device,such as a server or a data center, integrating one or more usable media.The usable medium may be a magnetic medium (for example, a floppy disk,a hard disk drive, or a magnetic tape), an optical medium (for example,a DVD), a semiconductor medium (for example, a solid state drive (solidstate drive, SSD)), or the like. In embodiments of this application, thecomputer may include the apparatus described above.

Although this application is described with reference to embodiments, ina process of implementing this application that claims protection, aperson skilled in the art may understand and implement another variationof the disclosed embodiments by viewing the accompanying drawings,disclosed content, and appended claims. In the claims, “comprising”(comprising) does not exclude another component or another step, and “a”or “one” does not exclude a case of multiple. A single processor oranother unit may implement several functions enumerated in the claims.Some measures are recorded in dependent claims that are different fromeach other, but this does not mean that these measures cannot becombined to produce a better effect.

Although this application is described with reference to specificfeatures and embodiments thereof, it is clear that various modificationsand combinations may be made to them without departing from the spiritand scope of this application. Correspondingly, the specification andaccompanying drawings are merely example description of this applicationdefined by the accompanying claims, and are considered as any of or allmodifications, variations, combinations or equivalents that cover thescope of this application. It is clearly that a person skilled in theart can make various modifications and variations to this applicationwithout departing from the spirit and scope of this application. Thisapplication is intended to cover these modifications and variations ofthis application, provided that they fall within the scope of the claimsand their equivalent technologies of this application.

What is claimed is:
 1. A wireless projection method, applied to a Wi-Ficommunication system, and comprising: transmitting, by an electronicdevice, a scalable video coding slice of a first video frame to adisplay device in a first video transmission period; obtaining, by theelectronic device, channel state information that is fed back by thedisplay device and that is for transmitting the first video frame; andselectively enabling, by the electronic device, a retry mechanism basedon the channel state information, wherein the retry mechanism is thatthe electronic device transmits a first scalable video coding slice of asecond video frame to the display device in a first time period in asecond video transmission period, and transmits, to the display devicein at least one another time period after the first time period, aportion that is of the first scalable video coding slice and that isdiscarded in the first time period, wherein one another scalable videocoding slice of the second video frame is transmitted in the at leastone another time period.
 2. The wireless projection method according toclaim 1, wherein the scalable video coding slice comprises one basiclayer and at least one enhancement layer; and that the electronic devicetransmits a first scalable coding slice of a second video frame in afirst time period in a second video transmission period comprises thatthe electronic device transmits a basic layer and at least oneenhancement layer of the first scalable video coding slice of the secondvideo frame to the display device in the first time period in the secondvideo transmission period based on transmission priorities of the basiclayer and the at least one enhancement layer of the first scalable videocoding slice of the second video frame.
 3. The wireless projectionmethod according to claim 1, wherein the scalable video coding slicecomprises the one basic layer and the at least one enhancement layer,the at least one another time period comprises a second time period inthe second video transmission period, and the another scalable videocoding slice comprises a second scalable video coding slice of thesecond video frame; and that the electronic device transmits, to thedisplay device in at least one another time period after the first timeperiod, a portion that is of the first scalable video coding slice andthat is discarded in the first time period comprises: the electronicdevice transmits, to the display device in the second time period basedon the transmission priorities of the basic layer and the at least oneenhancement layer of the first scalable video coding slice andtransmission priorities of a basic layer and at least one enhancementlayer of the second scalable video coding slice, the portion that is ofthe first scalable video coding slice and that is discarded and thesecond scalable video coding slice, wherein the transmission priority ofthe basic layer of the first scalable video coding slice is higher thanthe transmission priority of the basic layer of the second scalablevideo coding slice, the transmission priority of the basic layer of thesecond scalable video coding slice is higher than the transmissionpriority of the enhancement layer of the first scalable video codingslice, and the transmission priority of the enhancement layer of thefirst scalable video coding slice is higher than the transmissionpriority of the enhancement layer of the second scalable video codingslice.
 4. The wireless projection method according to claim 1, whereinthe discarded portion of the first scalable video coding slice comprisesthe basic layer and the at least one enhancement layer of the firstscalable video coding slice; and that the electronic device transmits,to the display device in at least one another time period after thefirst time period, a portion that is of the first scalable video codingslice and that is discarded in the first time period comprises: theelectronic device transmits the basic layer and the at least oneenhancement layer of the first scalable video coding slice to thedisplay device in the at least one another time period after the firsttime period.
 5. The wireless projection method according to claim 1,wherein the discarded portion of the first scalable video coding slicecomprises the at least one enhancement layer of the first scalable videocoding slice; and that the electronic device transmits, to the displaydevice in at least one another time period after the first time period,a portion that is of the first scalable video coding slice and that isdiscarded in the first time period comprises: the electronic devicetransmits the at least one enhancement layer of the first scalable videocoding slice to the display device in the at least one another timeperiod after the first time period.
 6. The wireless projection methodaccording to claim 1, further comprising: reconstructing, after the atleast one another time period, a reference frame based on a successfullytransmitted portion of the first scalable video coding slice; andgenerating first scalable video coding of a third video frame based onthe reference frame.
 7. A wireless projection method, applied to a Wi-Ficommunication system, and comprising: receiving, by a display device, ascalable video coding slice of a first video frame that is transmittedby an electronic device to the display device in a first videotransmission period; feeding back, by the display device to theelectronic device, channel state information for transmitting the firstvideo frame, wherein the electronic device selectively enables a retrymechanism based on the channel state information; decoding, by thedisplay device, the scalable video coding slice transmitted by theelectronic device in the first video transmission period; receiving, bythe display device, a first scalable video coding slice of a secondvideo frame transmitted by the electronic device in a first time periodin a second video transmission period in the retry mechanism; receiving,by the display device, a portion that is of the first scalable videocoding slice, that is discarded in the first time period, and that istransmitted by the electronic device in at least one another time periodafter the first time period, wherein one another scalable video codingslice of the second video frame is transmitted in the at least oneanother time period; and decoding, by the display device, the firstscalable video coding slice of the second video frame transmitted by theelectronic device in the first time period and the portion that is ofthe first scalable video coding slice, that is discarded in the firsttime period, and that is transmitted in the at least one another timeperiod after the first time period.
 8. The wireless projection methodaccording to claim 7, wherein the scalable video coding slice comprisesone basic layer and at least one enhancement layer; and the receiving,by the display device, a first scalable video coding slice of a secondvideo frame transmitted by the electronic device in a first time periodin a second video transmission period comprises: receiving, by thedisplay device, a basic layer and at least one enhancement layer of thefirst scalable video coding slice of the second video frame that aretransmitted by the electronic device in the first time period in thesecond video transmission period based on transmission priorities of thebasic layer and the at least one enhancement layer of the first scalablevideo coding slice.
 9. The wireless projection method according to claim7, wherein the scalable video coding slice comprises the one basic layerand the at least one enhancement layer; and the receiving, by thedisplay device, a portion that is of the first scalable video codingslice, that is discarded in the first time period, and that istransmitted by the electronic device in at least one another time periodafter the first time period comprises: receiving, by the display device,the basic layer and the at least one enhancement layer of the firstscalable video coding slice that are transmitted by the electronicdevice in the at least one another time period after the first timeperiod.
 10. The wireless projection method according to claim 7, whereinthe scalable video coding slice comprises the one basic layer and the atleast one enhancement layer; and the receiving, by the display device, aportion that is of the first scalable video coding slice, that isdiscarded in the first time period, and that is transmitted by theelectronic device in at least one another time period after the firsttime period comprises: receiving, by the display device, the at leastone enhancement layer of the first scalable video coding slicetransmitted by the electronic device in the at least one another timeperiod after the first time period.
 11. A wireless projection apparatus,used in a Wi-Fi communication system, and comprising: a transmitter,configured to transmit a scalable video coding slice of a first videoframe to a display device in a first video transmission period; areceiver, configured to obtain channel state information that is fedback by the display device and that is for transmitting the first videoframe; and a processor, configured to selectively enable a retrymechanism based on the channel state information obtained by thereceiver, wherein the retry mechanism is that the transmitter is furtherconfigured to: transmit a first scalable video coding slice of a secondvideo frame to the display device in a first time period in a secondvideo transmission period, and transmit, to the display device in atleast one another time period after the first time period, a portionthat is of the first scalable video coding slice and that is discardedin the first time period, wherein one another scalable video codingslice of the second video frame is transmitted in the at least oneanother time period.
 12. A wireless projection apparatus, used in aWi-Fi communication system, and comprising: a receiver, configured toreceive a scalable video coding slice of a first video frame that istransmitted by an electronic device to a display device in a first videotransmission period; a transmitter, configured to feed back, to theelectronic device, channel state information for transmitting the firstvideo frame, wherein the electronic device selectively enables a retrymechanism based on the channel state information; and a processor,configured to decode the scalable video coding slice transmitted by theelectronic device in the first video transmission period, wherein thereceiver is further configured to: receive a first scalable video codingslice of a second video frame transmitted by the electronic device in afirst time period in a second video transmission period in the retrymechanism, and receive a portion that is of the first scalable videocoding slice and that is discarded in the first time period and that istransmitted by the electronic device in at least one another time periodafter the first time period, wherein one another scalable video codingslice of the second video frame is transmitted in the at least oneanother time period; and the processor is further configured to decodethe first scalable video coding slice of the second video frametransmitted by the electronic device in the first time period and theportion that is of the first scalable video coding slice and that isdiscarded in the first time period and that is transmitted in the atleast one another time period after the first time period.